package GameEngine.Animation.Programmed;

import GameEngine.helper.PAppletBridge;


public class BeamAnimation extends Animation {
	private int bl = 10;

	public BeamAnimation(int n, int max, int beamlength) {
		super(n, 0, max);
		bl = beamlength;
	}

	public void animate(int x, int y) {
		if (isRunning()) {
			float size = currentValue();

			PAppletBridge.pushMatrix();
			PAppletBridge.translate(x, y);

			PAppletBridge.rotate(PAppletBridge.radians(size));

			PAppletBridge.fill(0xffE52E31, 100);
			//PAppletBridge.noStroke();
			PAppletBridge.rect(-5, 0, 10, -bl);

			PAppletBridge.popMatrix();
		}
	}
}
